<template>
	<view class="content" style="overflow-x:hidden;">
		<!-- 顶部导航栏组件 -->
		<QSNavbar :navbarItems="navbarItems_1" backgroundColor="#2F75FA" ref="navbar"></QSNavbar>

		<u-sticky :customNavHeight="navbarHeigth" v-if="navbarHeigth">
			<!-- 气泡背景图 -->
			<view class="bubble-back">
				<u-image :src="bubbleBackgroundImage" width="100%" mode="widthFix" />

				<view class="user-info">
					<view class="user-info-left" v-if="userLoginPhone">
						<image style="width: 150rpx; height: 150rpx;border-radius: 50%;" v-if="heading != ''"
							:src="heading">
						</image>
						<u-avatar v-else :src="avatarDemo" size="150rpx"></u-avatar>

						<!-- <view class="user-info-left-label">
							<u-tag text="馆长" plain size="mini" bgColor="#fff" shape="circle"
								borderColor="rgba(0,0,0,0)"></u-tag>
						</view> -->
					</view>
					<view class="user-info-left" v-if="!userLoginPhone">
						<u-avatar size="150rpx"></u-avatar>
					</view>
					<view class="user-info-center flex-grow-1">
						<view class="flex-between" v-if="userLoginPhone">
							<view class="user-info-center-one flex-align">
								<!-- <navigator url="/pages/personal/user-info/user-info" class="flex-align"> -->
								<!-- <u-text :text="userLoginPhone" size="36rpx" :bold="true" color="#fff" lines="1">
								</u-text> -->
								<text
									style="font-size: 36rpx;color: #ffffff;font-weight: bold;">{{userLoginPhone}}</text>
								<u-text :text="username" size="36rpx" :bold="true" color="#fff" lines="1">
								</u-text>
								<!-- <text  style="white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;font-size: 30rpx;color: #ffffff;">zasdzasd银行啥是是</text> -->
								<!-- <u-icon name="arrow-right" color="#fff" size="24rpx"></u-icon> -->
								<!-- </navigator> -->
								<!-- <u-tag text="未录入人脸" size="mini" type="error" shape="circle"></u-tag> -->
							</view>
							<view 
								style="width: 22%;height: 50rpx;background-color: #ffffff;color: #55aaff;border-radius: 25rpx 0% 0% 25rpx;font-size: 24rpx;"
								@click="renzhen()">
								<text style="margin-left: 30rpx;line-height: 50rpx;">已认证</text>
							</view>
							<!-- <view v-else
								style="width: 22%;height: 50rpx;background-color: #ff0000;color: #ffffff;border-radius: 25rpx 0% 0% 25rpx;font-size: 24rpx;"
								@click="renzhen()">
								<text style="margin-left: 30rpx;line-height: 50rpx;">未认证</text>
							</view> -->
							<!-- <navigator url="/pages/personal/user-info/user-info?edit=true">
								<u-image width="34rpx" height="30rpx"
									src="https://jiangsudiantuo2022.oss-cn-hangzhou.aliyuncs.com/img/9a42e1d30c1bce1e869618f7ea2a00e91858f363.png">
								</u-image>
							</navigator> -->
						</view>
						<view class="user-info-center-one" @click="pleaseLogin" v-else>
							<u-text text="请登录" size="36rpx" bold color="#fff" lines="1"></u-text>
						</view>
						</button>

						<view class="user-info-center-two d-flex" v-if="userLoginPhone" style="margin-top: 6rpx;">
							<u-image width="30rpx" height="29rpx"
								src="https://codefun-proj-user-res-1256085488.cos.ap-guangzhou.myqcloud.com/61a6df60dc329c0011115679/61a70accdc329c0011116ca9/16396280658215885444.png">
							</u-image>
							<u-text text="初级会员" size="22rpx" bold color="#fff"></u-text>

						</view>
						<!-- <view class="flex-between" v-if="userLoginPhone" style="margin-top: 16rpx;">
							<view class="user-info-center-three d-flex">
								<navigator url="/pages_other/my-points/my-points" class="text flex-align">
									<u-image width="33rpx" height="28rpx"
										src="https://codefun-proj-user-res-1256085488.cos.ap-guangzhou.myqcloud.com/61a6df60dc329c0011115679/61a70accdc329c0011116ca9/16396280659105279945.png">
									</u-image>
									<text
										style="font-size: 22rpx;color: #ffffff;margin-left: 4rpx;font-weight: bold;">积分:{{jifen}}</text>
								</navigator>
								<navigator url="/pages_a/coupons/coupons" class="text flex-align">
									<u-image width="34rpx" height="24rpx"
										src="https://codefun-proj-user-res-1256085488.cos.ap-guangzhou.myqcloud.com/61a6df60dc329c0011115679/61a70accdc329c0011116ca9/16500308753218334050.png">
									</u-image>
									<u-text text="优惠券:0" size="22rpx" bold color="#fff"></u-text>
								</navigator>
								<navigator url="/pages_a/my-wallet/my-wallet" class="text flex-align">
									<u-image width="33rpx" height="25rpx"
										src="https://codefun-proj-user-res-1256085488.cos.ap-guangzhou.myqcloud.com/61a6df60dc329c0011115679/61a70accdc329c0011116ca9/16500308754778642627.png">
									</u-image>
									<u-text text="余额:0" size="22rpx" bold color="#fff"></u-text>
								</navigator>
							</view>
						</view> -->
					</view>
				</view>

				<view class="my-menu" v-if="userLoginPhone">
					<u-image :src="myMenue" width="700rpx" height="150rpx" :showMenuByLongpress="false"
						mode="scaleToFill">
					</u-image>
					<view class="cates">
						<view class="cate-item pr" v-for="(item, index) in myMenuCate" :key="index"
							@click="onClickMenu(item)">
							<view class="u-page__tag-item">
								<u-badge :value="item.badge" numberType="overflow" isDot :show="item.badge"></u-badge>
								<!-- <u-badge :isDot="true" type="success"></u-badge> -->
							</view>
							<u-image :src="item.icon" width="50rpx" height="50rpx" :showMenuByLongpress="false">
							</u-image>
							<text>{{item.name}}</text>
							<!-- <u-badge numberType="overflow" type="error" max="99" :value="item.badge" :show="item.badge" absolute :offset="[-13, 9]" /> -->
						</view>
					</view>
				</view>
			</view>
		</u-sticky>


		<block v-if="userLoginPhone">

			<!-- 我的档案袋 & 其他端口 -->
			<block v-for="(item,index) in list">
				<zqBox v-model="scrollTop">
					<view :class="item.className">
						<view class="my-menu-title">
							<text class="title">{{ item.title }}</text>
							<!-- <text class="box"></text> -->
						</view>
						<view class="menu-cates">
							<view class="menu-cate-item" v-for="(it, indexs) in item.menuList" :key="indexs"
								@click="onClickMenu(it)">
								<view class="pr flex-center flex-column">
									<u-badge numberType="overflow" type="error" max="99" :value="it.badge"
										:show="it.badge" absolute :offset="[-5, -5]" />
									<u-image :src="it.icon" width="43rpx" height="46rpx" v-if="item.title == '其他端口'" />
									<u-image :src="it.icon" :width="it.width || '68rpx'" :height="it.height || '68rpx'"
										v-else />
									<text>{{it.name}}</text>
								</view>
							</view>
						</view>
					</view>
				</zqBox>
			</block>
			<!-- 一张通往B端的图片 -->
			<view class="b-image" @click="onTitleTap">
				<u--image :showLoading="true"
					src="https://jiangsudiantuo2022.oss-cn-hangzhou.aliyuncs.com/img/7073f7c186b9d9f28c65f24a5770a43373190e6b.png"
					width="100%" height="140rpx" radius="50px" :showMenuByLongpress="false" @click="click"></u--image>
			</view>
			<!-- 最后的元素 -->
			<u-cell-group :customStyle="{'margin':22+'rpx'}">
				<u-cell :icon="footerMenuImage[0]" title="关于我们" isLink url="/pages_other/about/about"
					:iconStyle="{width:34+'rpx',height:34+'rpx'}"></u-cell>
				<u-cell :icon="footerMenuImage[1]" title="意见反馈" isLink url="/pages_other/feedback/feedback"
					:iconStyle="{width:34+'rpx',height:28+'rpx'}"></u-cell>
				<u-cell :icon="footerMenuImage[2]" title="商务合作" isLink url="/pages_other/cooperate/cooperate"
					:iconStyle="{width:34+'rpx',height:31+'rpx'}"></u-cell>
				<!-- <u-cell :icon="footerMenuImage[3]" title="系统设置" isLink :iconStyle="{width:34+'rpx',height:32+'rpx'}"></u-cell> -->
				<!-- <u-cell :icon="footerMenuImage[4]" title="隐私说明" isLink :iconStyle="{width:28+'rpx',height:34+'rpx'}"></u-cell> -->
			</u-cell-group>
		</block>

		<!-- 版本号 -->
		<view style="margin-bottom: 20rpx;" @click="openUrl" v-if=" userLoginPhone !=''">
			<u-text :text="version_num" size="22rpx" :bold="true" align="center" lines="1" color="rgb(153,153,153)">
			</u-text>
		</view>

		<!-- 底部导航组件 -->
		<tarbar :valueModel="tabbar_index" :footerArr="homeData.footer"></tarbar>
	</view>
</template>

<script>
	import QSNavbar from '@/components/QS-Navbar/QS-Navbar.vue';
	import tarbar from '@/components/tarbar/index.vue'
	import zqBox from '@/uni_modules/zq-box/components/zq-box/zq-box.vue'
	const index = require('@/api/personal/index.js')
	const venues = require("@/api/venues/venues.js");
	const train = require("@/api/train/index.js");
	const subscribe = require('@/api/subscribe/index.js')
	export default {
		components: {
			tarbar,
			QSNavbar,
			zqBox
		},
		data() {
			return {
				navbarHeigth: null,
				assetsPath: this.$https.assetsPath,
				footerMenuImage: [
					this.$https.assetsPath + '2a0232259d0df3602f2fe5971043d6ce9450ed25.png',
					this.$https.assetsPath + 'eba7a97b45e85851d8078c866a4b4b740302ea8b.png',
					this.$https.assetsPath + '20a945dcf3e91e4f88155a3bcf071d12e36a21b3.png',
					this.$https.assetsPath + 'c3f861ba1ce8c529e129126f67a0a71cdc8d053c.png',
					this.$https.assetsPath + '66cf4ac3a6f324be94568d79a71634dc90c980e5.png',
				],
				list: [{
						className: 'orders',
						title: '我的订单',
						menuList: [{
								icon: this.$https.assetsPath + '54f10b3f9fb9d8b3ce7b375d08be4ea8edc16886.png',
								name: '全部订单',
								url: '/pages/personal/orders/orders?tab=0',
								width: '44rpx',
								height: '44rpx'
							},
							{
								icon: this.$https.assetsPath + 'fccae2bf26cd920a772964f691754a39aa078589.png',
								name: '待付款',
								url: '/pages/personal/orders/orders?tab=1',
								width: '44rpx',
								height: '44rpx',
								badge: ''
							},
							// {
							// 	icon: this.$https.assetsPath + '6e7713d16284e5d2ad6b10cab18c78952e9eb83c.png',
							// 	name: '未完成',
							// 	url: '/pages/personal/orders/orders?tab=2',
							// 	width: '44rpx',
							// 	height: '40rpx',
							// },
							{
								icon: this.$https.assetsPath + 'eaf77ebb561ca05980a92f0343ee46410c6590d1.png',
								name: ' 已付款',
								url: '/pages/personal/orders/orders?tab=2',
								width: '44rpx',
								height: '44rpx',
							},
							{
								icon: this.$https.assetsPath + '843f96d2baa1b3b0d30226d05f6bb76f2ba52de3.png',
								name: '退款/取消',
								url: '/pages/personal/orders/orders?tab=3',
								width: '44rpx',
								height: '44rpx',
							},
						]
					},
					{
						title: '我的档案袋',
						menuList: [
							// {
							// 	icon: this.$https.assetsPath + '0b62ebb86b40a110774c9387eaf3f17221a790a8.png',
							// 	name: '我的银行卡',
							// 	url: '/page_venues/pages/bank-card/bank-card'
							// },
							// {
							// 	icon: this.$https.assetsPath + 'b1871cd0b9a8aa88daf67cef8414804de4c9849c.png',
							// 	name: '我的学员',
							// 	url: '/page_venues/pages/student-archives/student-archives'
							// },
							// {
							// 	icon: this.$https.assetsPath + 'c8b7a7937e07c760c4b2fb22c4d5c587a331b831.png',
							// 	name: '我的队员',
							// 	url: '/page_venues/pages/member-info/member-info?xq=1'
							// },
							// {
							// 	icon: this.$https.assetsPath + 'd91eafd734f3987d420e98f941b0ed8518dccbd1.png',
							// 	name: '我的队伍',
							// 	url: '/page_venues/pages/team-info/team-info'
							// },

							// {
							// 	icon: this.$https.assetsPath + '206f10d5366c27ea6b04ae1ad432e9bad627aecb.png',
							// 	name: '我的地址',
							// 	url: '/page_venues/pages/mailing-address/mailing-address'
							// },
							// {
							// 	icon: this.$https.assetsPath + 'b0666de2249d5e6592cdf8aeaeda0ed3710bb303.png',
							// 	name: '我的发票',
							// 	url: '/page_venues/pages/invoice-header/invoice-header'
							// },
							// {
							// 	icon: this.$https.assetsPath + 'ef33a3f1bb12a57bae06bba7d1b4e874ff68607b.png',
							// 	name: '我的车辆',
							// 	url: '/page_venues/pages/cars-info/cars-info'
							// },
							// {
							// 	icon: this.$https.assetsPath + '8fd913115e9e00095f271ffdfe606f4437c07dc1.png',
							// 	name: '企业信息',
							// 	url: '/pages_a/company-info/company-info'
							// },
							{
								icon: this.$https.assetsPath + '262897bbfb59a769ebe2c604f4a35f1326ce9b08.png',
								name: '我的球友',
								url: '/pages_other/teammate/my-teammate'
							},
							// {
							// 	icon: this.$https.assetsPath + 'b9dd307d399465861ac7fa28dafda743f10a16e6.png',
							// 	name: '我的兑换',
							// 	url: '/page_points/page_points/exchange_record'
							// },
							// {
							// 	icon: this.$https.assetsPath + 'fda56882382f63f8148f29c0765245006639257d.png',
							// 	name: '好友栏',
							// 	url: '/pages_other/cardbag/card_recipient'
							// },
							// {
							// 	icon: this.$https.assetsPath + '32390cfa58ccd3c8f15ecc0efa79a8fd5c07b83f.png',
							// 	name: '我的礼品',
							// 	url: '/page_points/my_gift/my_gift'
							// },
							// {
							// 	icon: this.$https.assetsPath + 'fda56882382f63f8148f29c0765245006639257d.png',
							// 	name: '个人码',
							// 	url: '/page_points/personal_code'
							// },

						]
					},
					// {
					// 	title: '其他端口',
					// 	menuList: [
					// 		{
					// 			icon: this.$https.assetsPath + '4add7d1fd466088e4c13c8be1b8018215c4f557a.png',
					// 			name: '报表端'
					// 		},
					// 		{
					// 			icon: this.$https.assetsPath + '6b46a051f4e5bc88b480f87c84ed08bbb2d5b795.png',
					// 			name: '审核端'
					// 		},
					// 		{
					// 			icon: this.$https.assetsPath + '08ccde28500d57175fe6d8d49e3c9bf0c8a5df2e.png',
					// 			name: '商户端'
					// 		},
					// 		{
					// 			icon: this.$https.assetsPath + 'e48509277ae830e1eb2022027f24afc26b5b71fe.png',
					// 			name: '维修端'
					// 		},
					// 		{
					// 			icon: this.$https.assetsPath + '566ee25549b8f976faf4d943cbf448d76da18303.png',
					// 			name: '设备管控'
					// 		},
					// 		{
					// 			icon: this.$https.assetsPath + 'a1322feb11c9158b9a898e8c38865b17f94d8b00.png',
					// 			name: '教练端'
					// 		},
					// 		{
					// 			icon: this.$https.assetsPath + '1ee41c6e7be2d6425aa028a44526a4232df11fde.png',
					// 			name: '客服端'
					// 		},
					// 		{
					// 			icon: this.$https.assetsPath + 'd8b0cf48bd6d391e67bae9b03f980175207d1b39.png',
					// 			name: '学生端'
					// 		},
					// 		{
					// 			icon: this.$https.assetsPath + 'f68136b240320e4ea98c190b4356aa9f32912a5e.png',
					// 			name: '基础功能'
					// 		},
					// 		{
					// 			icon: this.$https.assetsPath + '036cf133522a4acd45baf7b71a7f8567f3b90e74.png',
					// 			name: '营销端'
					// 		},
					// 	]
					// },
				],
				myMenuCate: [{
						icon: this.$https.assetsPath + 'f7492c92f2c6bf41d09cfc1d2a3e8d918e337fee.png',
						name: '我的卡包',
						url: '/pages/personal/card-pack/card-pack',
					},
					{
						icon: this.$https.assetsPath + '26864f16f1aacbe1d12441e4907d182cc8f008af.png',
						name: '我的票夹',
						url: '/pages/personal/ticket-holder/ticket-holder',
					},
					{
						icon: this.$https.assetsPath + '27a052eb2c56ace72bdd0a2aafbf3ec6a947e5a3.png',
						name: '我的场地',
						url: '/pages_a/my-venues/my-venues'
					},
					{
						icon: this.$https.assetsPath + 'd72b874e0432da0cd9ada93094ad498611d28da0.png',
						name: '我的课包',
						url: '/pages_a/my-lesson/my-lesson',
					},
					{
						icon: this.$https.assetsPath + '165a0d75e4adb53c2f33db2b240e2a4f27c2648f.png',
						name: '我的赛事',
						url: '/pages_a/my-event/my-event'
					},
				],
				myMenue: this.$https.assetsPath + '959f358dc6713540125082ef6bacd1a2836b10a1.png',
				avatarDemo: this.$https.assetsPath + '98211cea862fd8ddd0c3a8ad53dee51d0fb225bc.png',
				bubbleBackgroundImage: this.$https.assetsPath + '3a2d36f8b226f37603f756fef62f2b91c8091ef8.png',
				// tabbar_index: 3,
				tabbar_index: 0,
				homeData: [],
				navbarItems_1: [{
					type: 'text',
					text: '个人中心',
					width: 70,
					weight: 'bold',
					color: '#fff',
					textAlign: 'left'
				}],
				userLoginPhone: '',
				heading: '',
				jifen: '',
				username: '',
				version_num: "",
				link_url: '',
				is_sure: 1,
				openidlist: '',
				page_url:'/pages/personal/personal'
			};
		},
		onLoad(options) {
			this.openidlist = options.openidlist
			// 获取页面设置配置
			// 获取学员资料
			let that = this
			let params = {
				app_id: this.$https.weixinAppId,
			}
			index.getProjectIdByAppId(params).then(result => {
				getApp().globalData.projectId = result.data.result
				getApp().globalData.sign = result.data.sign;
				// if (uni.getStorageSync('tarbar_index')) {
				// 	that.tabbar_index = uni.getStorageSync('tarbar_index')
				// }
				if (uni.getStorageSync('phone')) {
					that.userLoginPhone = uni.getStorageSync('phone')
					that.getLocation();
				}
				// 查询对应小程序的配置信息
				that.getAppletConfig()
				that.getMyInfolist()
				that.getPoints()
				that.AoutUs_s()
			})
			
		},
		onReady() {
			this.$refs.navbar.getQuery(res => {
				this.navbarHeigth = res.height;
			});
			this.getMyTicketCount()
			this.getMyCardCount()
			this.getMyPaymentNum()
		},
		onShow() {
			this.getMyTicketCount()
			this.getMyCardCount()
			this.getMyPaymentNum()
			this.getMyInfolist()
			this.getMyCourtNum()
			this.getMyEnrollNum()
			this.getMyClassNum()
		},
		methods: {
			
			async getLocation() {
				const [err, res] = await uni.getLocation({
					isHighAccuracy: true, // 开启地图精准定位
					type: "gcj02",
				});
			},
			onTitleTap(){
				// uni.navigateToMiniProgram({
				//   appId: 'wx8814818d840da21a',
				//   path: 'pages/index/index',
				//   extraData: {
				//     'data1': 'test'
				//   },
				//   success(res) {
				//     // 打开成功
				// 	console.log(res,'123')
				//   },
				//   fail: err => {
				// 	   console.log(err);
				//   }
				// })
				// uni.navigateTo({
				// 	url: '/pages/overtime/index'
				// })
			},
			renzhen() {
				uni.navigateTo({
					url: './user-info/user-info?edit=true'
				})
			},
			openUrl() {
				uni.navigateTo({
					url: `/page_points/webview/webview`
					// url: `/page_points/webview/webview1?url=${this.link_url}`
					
				})
				// console.log(uni.getStorageSync("template_ids"),'999')
				// uni.requestSubscribeMessage({
				// 	tmplIds: [uni.getStorageSync("template_ids").act_notice],
				// 	success(ru) {
						
				// 	}
				// })
			},
			// 获取课节
			async AoutUs_s(train_id) {
				let postData = {
					app_id: this.$https.weixinAppId,
					project_id: getApp().globalData.projectId,
				}
				let res = await train.aboutUs(postData)
				if (res.code === 1) {
					this.version_num = res.data.result.version_num
					this.link_url = res.data.result.link_url
				}
			},
			// 球场数量
			async getMyCourtNum() {
				let that = this
				let postData = {
					project_id: getApp().globalData.projectId,
					open_id: uni.getStorageSync('openid'),
					app_id: this.$https.weixinAppId,
				}
				let res = await venues.getMyCourtNum(postData)
				if (res.code === 1) {
					that.myMenuCate[2].badge = res.data.num
				}
			},
			// 赛事数量
			async getMyEnrollNum() {
				let that = this
				let postData = {
					project_id: getApp().globalData.projectId,
					open_id: uni.getStorageSync('openid'),
					app_id: this.$https.weixinAppId,
				}
				let res = await venues.getMyEnrollNum(postData)
				if (res.code === 1) {
					that.myMenuCate[4].badge = res.data.num
				}
			},
			// 培训数量
			async getMyClassNum() {
				let that = this
				let postData = {
					project_id: getApp().globalData.projectId,
					user_id: uni.getStorageSync("phone"),
					appid: this.$https.weixinAppId,
					openid: uni.getStorageSync("openid"),
				}
				let res = await venues.getMyClassNum(postData)
				if (res.code === 1) {
					that.myMenuCate[3].badge = res.data.num
				}
			},
			async getPoints() {
				// uni.showLoading({
				// 	title: "加载中...",
				// 	mask: true,
				// });
				let params = {
					app_id: this.$https.weixinAppId,
					project_id: getApp().globalData.projectId,
					open_id: uni.getStorageSync('openid'),
				};
				let res = await index.getPoints(params);
				if (res.code === 1) {
					this.jifen = res.data.result
					// this.$nextTick(() => {
					// 	uni.hideLoading();
					// });
				}
			},
			// 获取我的待付款订单
			async getMyInfolist() {
				// uni.showLoading({
				// 	title: "加载中...",
				// 	mask: true,
				// });
				let params = {
					appid: this.$https.weixinAppId,
					project_id: getApp().globalData.projectId,
					openid: uni.getStorageSync('openid'),
				};
				let res = await venues.getMyInfo(params);
				if (res.code === 1) {
					this.heading = res.data.data.headimg
					this.username = res.data.data.username
					this.is_sure = res.data.data.is_sure
					uni.setStorageSync('is_sure',res.data.data.is_sure)
					// this.$nextTick(() => {
					// 	uni.hideLoading();
					// });
				}
			},
			// 获取我的票数量
			async getMyTicketCount() {
				let that = this
				let postData = {
					project_id: getApp().globalData.projectId,
					user_id: uni.getStorageSync('openid'),
					appid: this.$https.weixinAppId,
				}
				let res = await index.getMyTicketCount(postData)
				if (res.code == 1) {
					that.myMenuCate[1].badge = res.data.ticketData
				}
			},
			// 获取我的会员卡数量
			async getMyCardCount() {
				let that = this
				let postData = {
					project_id: getApp().globalData.projectId,
					user_id: uni.getStorageSync('openid'),
					appid: this.$https.weixinAppId,
				}
				let res = await index.getMyCardCount(postData)
				if (res.code == 1) {
					that.myMenuCate[0].badge = res.data.cardData
				}
			},

			// 获取我的待付款数量
			async getMyPaymentNum() {
				let that = this
				let postData = {
					project_id: getApp().globalData.projectId,
					owner: uni.getStorageSync('phone'),
					app_id: this.$https.weixinAppId,
				}
				let res = await index.getMyPaymentNum(postData)
				if (res.code == 1) {
					that.list[0].menuList[1].badge = res.data.count
				}
			},

			async getAppletConfig() {
				// uni.showLoading({
				// 	title: '加载中...',
				// 	mask: true
				// })
				let that = this
				let data = {
					'weixinAppId': this.$https.weixinAppId,
					'projectId': getApp().globalData.projectId,
				}
				let result = await index.index(data)
				if (result.code == 1) {
					that.homeData = result.data // 首页完整数据
					this.homeData.footer.forEach((item,index)=>{
						if (this.page_url == item.page_url) {
							this.tabbar_index = index
						} 
					})
					this.$nextTick(function() {
						this.homeData.footer[this.tabbar_index].this_icon = this.homeData.footer[this
							.tabbar_index].selected_icon
					}) // 默认选中底部Tabbar
					// uni.hideLoading()
				}
			},
			pleaseLogin() {
				let that = this
				uni.showLoading({
					success(res) {
						if (res.errMsg == 'showLoading:ok') {
							uni.hideLoading()
							uni.navigateTo({
								url: '/pages/loginPage/loginPage?applet_name=' + that.homeData
									.name
							})
						}
					},
					mask: true
				})
			},
			onClickMenu(item) {
				if (item.url) {
					uni.navigateTo({
						url: item.url
					});
				}
			}
		}
	}
</script>

<style lang="scss">
	@import url("@/static/css/personal/index.css");

	.u-page__tag-item {
		width: 100%;
		height: 16rpx;
		margin-left: 170rpx;
		box-sizing: border-box;
	}
</style>
